#include <stdio.h>

int main(){
	int a[] = {2,4,5,7,9,10,13,15,18,20};
	int b[10] = {1,2,3,6,8,10,12,14,19,21};

	int N = 10;
	int i = 0;
	int j = 0;
	printf("a[]=");
	for (i = 0; i < N; i++){
		printf("%d ",a[i]);
	}
	printf("\n");

	printf("b[]=");
	for (i = 0; i < N; i++){
		printf("%d ",b[i]);
	}
	printf("\n");

	for (i = 0; i < N; i++){
		for (j = N + i -1; j >= 0; j--){
			if(b[i] < a[j]){
				a[j+1] = a[j];
			}else{break;}
		}
		a[j+1] = b[i];
	}

	printf("a[]=");
	for (i = 0; i < 2 * N; i++){
		printf("%d ",a[i]);
	}
	printf("\n");

	return 0;
}
